<div class="box">
	<div class="box-body">
		<div class="row marginZero">
				<div class="table-responsive">
					 <epoch:table id="sysOssConfig" queryUrl="${basePath}/sys/oss/findSysOSSListAjax" rowId="id" showRefresh="true"
					        newBtn="false" delBtn="false" onAddClick="addClick" filter="false">
					        <epoch:moreBtn position="0">
			                    <button type="button" class="btn btn-primary btn-sm" id="upload">
			                        <span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span>上传
			                    </button>
						    </epoch:moreBtn>
					        <epoch:tr check="checkbox" titleTip="全选"></epoch:tr>
					        <epoch:tr name="URL" formName="url" width="60%">	
					        </epoch:tr>
					        <epoch:tr name="创建人" formName="user_name" width="15%"></epoch:tr>
					        <epoch:tr name="创建时间" formName="CREATE_DATE" width="15%"></epoch:tr>
					        <epoch:tr name="操作" switchable="false">
					             <button class="btn btn-danger btn-xs" onclick="delRows('~{row.id}');">
				                	<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除
				              	</button>
					        </epoch:tr>
				    </epoch:table>
		        </div>
		</div>
	</div>
</div>
<script type="text/javascript">
new AjaxUpload('#upload', {
		action : "${basePath}/sys/oss/upload",
		name : 'file',
		autoSubmit : true,
		responseType : "json",
		onSubmit : function(file, extension) {
			if (!(extension && /^(jpg|jpeg|png|gif|mp4|webm|ogg)$/
					.test(extension.toLowerCase()))) {
				alert('只支持jpg、png、gif格式的图片！');
				return false;
			}
		},
		onComplete : function(file, r) {
			if (r.code == 0) {
				MessageBox.success(r.message);
				$("#sysOssConfig").bootstrapTable("refresh");
			} else {
				MessageBox.error( r.message);
			}
		}
});

function delRows(id){
	CommonUtil.del(null, id, "${basePath}/sys/oss/delete",null,function(){
        _tabs.showPage("list",null,null,null)});
}

</script>